package main

import "fmt"

// 写一个 minSlice() 方法，传入一个 int 的切片并且返回最小值，再写一个 maxSlice() 方法返回最大值。

func minSlice(s []int) (min int) {
	min = s[0]
	for _, v := range s {
		if v < min {
			min = v
		}
	}
	return
}

func maxSlice(s []int) (max int) {
	max = s[0]
	for _, v := range s {
		if v > max {
			max = v
		}
	}
	return
}

func main() {
	sli := []int{22, 55, 33, 66, 21, 63}
	fmt.Println("min of slice: ", minSlice(sli))
	fmt.Println("max of slice: ", maxSlice(sli))
}
